/*
 * @Description:
 * @Author: cgt
 * @Date: 2021-12-23 14:05:56
 * @LastEditors: cgt
 * @LastEditTime: 2021-12-28 19:57:50
 */
const saveMethods = {
  methods: {
    saveDeviceProperties() {
      return new Promise((resolve) => {
        let params = {
          params: { verRule: this.params.defaultOptions.verRule },
          data: {
            schema: this.params.data.schema,
            ghrw: this.params.data.ghrw,
            ghfa: this.params.data.ghfa,
            ghnf: this.params.data.ghnf,
            ghxm: this.params.data.ghxm,
            fxlx: this.params.data.fxlx,
            oid: this.params.data.oid,
            sblx: this.params.data.sblx,
            sbzlx: this.params.data.sbzlx,
            otherfields: this.form
          }
        };
        this.getMap()
          .api.PwghGhsjTxfw.sbjh.post_sbjh_modifyEquips(params)
          .then((res) => {
            if (res.resp_code === 200) {
              resolve();
            }
          });
      });
    },
    saveDeviceAndLinesShape() {
      return new Promise((resolve) => {
        let params = {
          params: { schema: this.params.data.schema, ghrw: this.params.data.ghrw },
          data: this.params.data.shapeList
        };
        this.getMap()
          .api.PwghGhsjTxfw.sbjhSave.post_sbjhSave_saveJhsb(params)
          .then((res) => {
            if (res.resp_code === 200) {
              resolve();
            }
          });
      });
    }
  }
};

export default saveMethods;